<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var num1 = setTimeout(function(){
            console.log('我是延时',new Date());
        },5000);
        
        // 5秒后打印当前的日期 只执行了一次 

        var num2 = setInterval(function(){
            console.log('我是间歇',new Date());
        },1000);

        // console.log(num1,num2);

        clearTimeout(num1);
        clearInterval(num2);
    </script>
</body>
</html>